Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad code show case #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

bad code show case #7

wants to merge 1 commit into from

Conversation

wenlei03
Copy link
Contributor

Try export onnx file

Try export onnx file

Signed-off-by: John <[email protected]>
@wenlei03
Copy link
Contributor Author

PR Analysis

  • 🎯 Main theme: The PR seems to be an attempt to add a new feature for exporting a model into ONNX format.
  • 📝 PR summary: The PR introduces a new class SubTreeExtractor and a function ddd. It also adds a line to export the SubTreeExtractor model into ONNX format. However, the function ddd seems to be incomplete and the usage of PyTorch's torch.onnx.export function seems incorrect.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 2, the PR is relatively small and the changes are straightforward, but there are some issues with the new code that need to be addressed.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR could benefit from some cleanup and correction. The function ddd seems to be incomplete and its purpose is unclear. The usage of torch.onnx.export is incorrect and needs to be fixed. It would also be helpful to add some comments explaining the purpose of the new class and function.

def forward(self, x, y):
return x + y

torch.onnx.export(SubTreeExtractor(), (torch.Tensor(1,2,3,4), 1), "1.onnx")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage of torch.onnx.export is incorrect. The second argument should be a tuple of tensors, but here it's a tuple of a tensor and an integer. Please correct this. [important]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant